package pers.cj.pdos.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;
import pers.cj.pdos.controller.base.BaseController;
import pers.cj.pdos.controller.entity.ResponseData;
import pers.cj.pdos.controller.entity.ResponseList;
import pers.cj.pdos.entity.AttrName;
import pers.cj.pdos.entity.Company;
import pers.cj.pdos.service.IAttrNameService;
import pers.cj.pdos.vo.AttrNameVo;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
@Controller
@RequestMapping("/goods")
public class AttrNameController extends BaseController {
    @Autowired
    private IAttrNameService attrNameService;

    @ResponseBody
    @RequestMapping("attrName/listVo")
    public ResponseData listVo (){
        Company company = getCompany();
        List<AttrNameVo> attrNameVoList = attrNameService.listVo(company.getId());
        return ResponseData.success(attrNameVoList);
    }

    @ResponseBody
    @RequestMapping("attrName/list")
    public ResponseData list (){
        Company company = getCompany();
        List<AttrName> attrNameList = attrNameService.list(company.getId());
        return ResponseData.success(attrNameList);
    }
}
